home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #1 / Amiga Plus CD - 2000 - No. 1.iso / Tools / GraKa / Picasso96Develop / Examples / ModeList.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-12-03  |  1.2 KB  |  53 lines

  1. /***********************************************************************
  2. * This is example shows how to use p96AllocModeListTagList()
  3. *
  4. * tabt (Sat Dec 28 03:44:35 1996)
  5. ***********************************************************************/
  6.  
  7. #include <proto/exec.h>
  8. #include <proto/dos.h>
  9. #include    <proto/graphics.h>
  10. #include <proto/picasso96.h>
  11.  
  12. #include <stdio.h>
  13.  
  14. char template[]="Width=W/N,Height=H/N,Depth=D/N";
  15.  
  16. LONG array[]={    0, 0, 0, FALSE    };
  17.  
  18. struct Library *P96Base;
  19.  
  20. void main(int argc,char **argv)
  21. {
  22.     if(P96Base=OpenLibrary("Picasso96API.library",2)){
  23.         struct RDArgs    *rda;
  24.         struct List        *ml;
  25.         LONG width=640, height=480, depth=8;
  26.         
  27.         if(rda=ReadArgs(template,array,NULL)){
  28.             if(array[0])    width =*((LONG *)array[0]);
  29.             if(array[1])    height=*((LONG *)array[1]);
  30.             if(array[2])    depth =*((LONG *)array[2]);
  31.             FreeArgs(rda);
  32.         }
  33.     
  34.         if(ml=p96AllocModeListTags(
  35.                                         P96MA_MinWidth, width,
  36.                                         P96MA_MinHeight, height,
  37.                                         P96MA_MinDepth, depth,
  38.                                         TAG_DONE)){
  39.             struct P96Mode    *mn;
  40.  
  41.             for(mn=(struct P96Mode *)(ml->lh_Head);
  42.                     mn->Node.ln_Succ;
  43.                     mn=(struct P96Mode *)mn->Node.ln_Succ){
  44.  
  45.                 printf("%s\n",mn->Description);
  46.             }
  47.  
  48.             p96FreeModeList(ml);
  49.         }
  50.         CloseLibrary(P96Base);
  51.     }
  52. }
  53.